(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
  (global = global || self, factory(global['yly-form-constants'] = {}));
}(this, (function (exports) { 'use strict';

  var NO_MODEL_COMPONENTS = ['button', 'divider', 'card', 'grid', 'table', 'alert', 'text', 'html'];
  var NO_MODEL_COMPONENTS_CODE = ['FORM_BUTTON', 'FORM_ALERT_BOX', 'FORM_STATIC_TEXT', 'FORM_DIVIDER_BOX', 'FORM_CARD', 'FORM_GRID'];
  var FORM_COMPONENT_FIELD = ['input', 'textarea', 'number', 'select', 'checkbox', 'radio', 'date', 'time', 'rate', 'slider', 'uploadFile', 'uploadImg', 'cascader', 'treeSelect', 'batch', 'editor', 'switch', 'button', 'alert', 'text', 'KPhoneInput', 'KDistpickerSelect', 'html', 'divider', 'card', 'grid', 'table', 'myField'];
  var NEED_CODE_NAME_COMPONENT_CODE = ['FORM_SELECT_INPUT', 'FORM_CHECK_BOX', 'FORM_AREA_SELECT'];

  /**
   * 自定义的业务组件
   */
  var CUSTOM_DEV_COMPONENT_CODE = ['MEASUREMENT', 'GOODS_ATTR', 'EXPECTED-OUTBOUND-OPERATION-GOODS', 'PUT_IN_STORAGE_ORDER_GOODS', 'PUT_IN_STORAGE_BILL_GOODS', 'RECEIVE_GOODS_DETAILS', 'PUT_AWAY_LIST', 'REVIEW_BILL_GOOD_DETAIL', 'TAKE_STOCK_ADD', 'START_TAKE_STOCK'];

  var FIELD_REFLECTION_COMPONENT = {
    // field 类型 <====> 组件类型
    string: 'FORM_INPUT'
  };

  var TEMPLATE_CONFIG_COMMON_FIELD = ['code', 'label', 'model', 'promptMessageContent', 'type', 'width', 'alignType'];
  var OPTIONS_ATTR_FIELD = ['afterSaveResetStatus', 'hidden', 'disabled', 'placeholder', 'rules', 'defaultValue', 'methods', 'editStatusHidden', 'editStatusDisabled'];
  var FORM_INPUT_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, ...OPTIONS_ATTR_FIELD, 'afterSaveResetStatus', 'clearable', 'dictCode'];
  var FORM_TEXTAREA_FIELD = [...FORM_INPUT_FIELD, 'maxRows', 'minRows'];
  /**
   * 数字输入
   */
  var FORM_NUMBER_INPUT_FIELD = [...FORM_INPUT_FIELD, 'maxRows', 'minRows'];
  /**
   * 选择框
   */
  var FORM_SELECT_INPUT_FIELD = [...FORM_INPUT_FIELD, 'dynamic', 'distal', 'options', 'fieldRelatedName'];
  /**
   * 复选框
   */
  var FORM_CHECK_BOX_FIELD = [...FORM_SELECT_INPUT_FIELD];
  /**
   * 复选框
   */
  var FORM_RADIO_BOX_FIELD = [...FORM_SELECT_INPUT_FIELD];
  /**
   * 日期
   */
  var FORM_DATE_SELECT_FIELD = [...FORM_INPUT_FIELD, 'format'];
  /**
   * 开关组件
   */
  var FORM_SWITCH_INPUT_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, ...OPTIONS_ATTR_FIELD];
  /**
   * 按钮
   */
  var FORM_BUTTON_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'onClick', 'onFocus', 'onBlur'];
  /**
   * 静态文本
   */
  var FORM_STATIC_TEXT_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'paddingLeft', 'textAlign', 'localComponent'];
  /**
   * 电话号码
   */
  var FORM_PHONE_INPUT_FIELD = [...FORM_INPUT_FIELD];
  /**
   * 级联
   */
  var FORM_CASCADE_SELECT_FIELD = [...FORM_SELECT_INPUT_FIELD];
  /**
   * 树
   */
  var FORM_TREE_SELECT_FIELD = [...FORM_SELECT_INPUT_FIELD];

  /**
   * 地区地址
   */
  var FORM_AREA_SELECT_FIELD = [...FORM_INPUT_FIELD, 'bindDataInfo'];

  /**
   * 线
   */
  var FORM_DIVIDER_BOX_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD];

  /**
   * 卡片
   */
  var FORM_CARD_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'list', 'orientation'];
  /**
   * 栅格
   */
  var FORM_GRID_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'colNum', 'columns'];
  /**
   * 字段集
   */
  var FORM_MY_FIELD_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'documentRule'];

  /**
   * 用户选择
   */
  var FORM_USER_SELECT_FIELD = [...FORM_INPUT_FIELD];
  /**
   * 组织选择
   */
  var FORM_ORG_SELECT_FIELD = [...FORM_INPUT_FIELD];
  /**
   * 单据号
   */
  var FORM_DOCUMENT_NUMBER_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'documentRule'];
  /**
   * 提示
   */
  var FORM_ALERT_BOX_FIELD = [...FORM_INPUT_FIELD];
  /**
   * 字段
   */
  var FORM_TEXT_FIELD_FIELD = [...FORM_INPUT_FIELD];
  var FORM_TABLE_FIELD = [...TEMPLATE_CONFIG_COMMON_FIELD, 'componentCode', 'componentName', 'configEvents'];
  var ComponentFieldMap = {
    TEMPLATE_CONFIG_COMMON_FIELD,
    OPTIONS_ATTR_FIELD,
    FORM_INPUT_FIELD,
    FORM_TEXTAREA_FIELD,
    FORM_NUMBER_INPUT_FIELD,
    FORM_SELECT_INPUT_FIELD,
    FORM_CHECK_BOX_FIELD,
    FORM_RADIO_BOX_FIELD,
    FORM_DATE_SELECT_FIELD,
    FORM_SWITCH_INPUT_FIELD,
    FORM_BUTTON_FIELD,
    FORM_STATIC_TEXT_FIELD,
    FORM_PHONE_INPUT_FIELD,
    FORM_CASCADE_SELECT_FIELD,
    FORM_TREE_SELECT_FIELD,
    FORM_AREA_SELECT_FIELD,
    FORM_DIVIDER_BOX_FIELD,
    FORM_CARD_FIELD,
    FORM_GRID_FIELD,
    FORM_MY_FIELD_FIELD,
    FORM_USER_SELECT_FIELD,
    FORM_ORG_SELECT_FIELD,
    FORM_DOCUMENT_NUMBER_FIELD,
    FORM_ALERT_BOX_FIELD,
    FORM_TEXT_FIELD_FIELD,
    FORM_TABLE_FIELD
  };
  var GetFormRenderConfigFieldByCode = componentCode => {
    if (componentCode && ComponentFieldMap[`${componentCode}_FIELD`]) {
      return ComponentFieldMap[`${componentCode}_FIELD`];
    }
    return FORM_INPUT_FIELD;
  };

  exports.CUSTOM_DEV_COMPONENT_CODE = CUSTOM_DEV_COMPONENT_CODE;
  exports.FIELD_REFLECTION_COMPONENT = FIELD_REFLECTION_COMPONENT;
  exports.FORM_ALERT_BOX_FIELD = FORM_ALERT_BOX_FIELD;
  exports.FORM_AREA_SELECT_FIELD = FORM_AREA_SELECT_FIELD;
  exports.FORM_BUTTON_FIELD = FORM_BUTTON_FIELD;
  exports.FORM_CARD_FIELD = FORM_CARD_FIELD;
  exports.FORM_CASCADE_SELECT_FIELD = FORM_CASCADE_SELECT_FIELD;
  exports.FORM_CHECK_BOX_FIELD = FORM_CHECK_BOX_FIELD;
  exports.FORM_COMPONENT_FIELD = FORM_COMPONENT_FIELD;
  exports.FORM_DATE_SELECT_FIELD = FORM_DATE_SELECT_FIELD;
  exports.FORM_DIVIDER_BOX_FIELD = FORM_DIVIDER_BOX_FIELD;
  exports.FORM_DOCUMENT_NUMBER_FIELD = FORM_DOCUMENT_NUMBER_FIELD;
  exports.FORM_GRID_FIELD = FORM_GRID_FIELD;
  exports.FORM_INPUT_FIELD = FORM_INPUT_FIELD;
  exports.FORM_MY_FIELD_FIELD = FORM_MY_FIELD_FIELD;
  exports.FORM_NUMBER_INPUT_FIELD = FORM_NUMBER_INPUT_FIELD;
  exports.FORM_ORG_SELECT_FIELD = FORM_ORG_SELECT_FIELD;
  exports.FORM_PHONE_INPUT_FIELD = FORM_PHONE_INPUT_FIELD;
  exports.FORM_RADIO_BOX_FIELD = FORM_RADIO_BOX_FIELD;
  exports.FORM_SELECT_INPUT_FIELD = FORM_SELECT_INPUT_FIELD;
  exports.FORM_STATIC_TEXT_FIELD = FORM_STATIC_TEXT_FIELD;
  exports.FORM_SWITCH_INPUT_FIELD = FORM_SWITCH_INPUT_FIELD;
  exports.FORM_TABLE_FIELD = FORM_TABLE_FIELD;
  exports.FORM_TEXTAREA_FIELD = FORM_TEXTAREA_FIELD;
  exports.FORM_TEXT_FIELD_FIELD = FORM_TEXT_FIELD_FIELD;
  exports.FORM_TREE_SELECT_FIELD = FORM_TREE_SELECT_FIELD;
  exports.FORM_USER_SELECT_FIELD = FORM_USER_SELECT_FIELD;
  exports.GetFormRenderConfigFieldByCode = GetFormRenderConfigFieldByCode;
  exports.NEED_CODE_NAME_COMPONENT_CODE = NEED_CODE_NAME_COMPONENT_CODE;
  exports.NO_MODEL_COMPONENTS = NO_MODEL_COMPONENTS;
  exports.NO_MODEL_COMPONENTS_CODE = NO_MODEL_COMPONENTS_CODE;
  exports.TEMPLATE_CONFIG_COMMON_FIELD = TEMPLATE_CONFIG_COMMON_FIELD;

  Object.defineProperty(exports, '__esModule', { value: true });

})));
